package com.dgut.hisystem.controller;


import com.dgut.hisystem.entity.Relationship;
import com.dgut.hisystem.service.RelationshipService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("/relationship")
@RestController
public class RelationshipController {
    @Resource
    private RelationshipService relationshipService;

    @RequestMapping("/get")
    Relationship getRelationshipById(int id) {
        return relationshipService.getRelationshipById(id);
    }

    @RequestMapping("/insert")
    void insert(@RequestBody Relationship relationship) {
        relationshipService.insert(relationship);
    }

    @RequestMapping("/update")
    void update(@RequestBody Relationship relationship) {
        relationshipService.update(relationship);
    }

    @RequestMapping("/delete")
    void delete(int id) {
        relationshipService.delete(id);
    }



}
